<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

//Route::middleware('auth:api')->get('/user', function (Request $request) {
//    return $request->user();
//});


use Illuminate\Support\Facades\Route;

$api = app('Dingo\Api\Routing\Router');
$func = function ($api) {
    //订阅from消息
    $api->group(['namespace' => 'App\Api\V2\Controller\Notify', 'prefix' => 'v2/Notify'], function ($api) {

        //https://test-pay.zgjindoufu.com/api/v2/Notify/AliyunNotify/notify
        $api->any("/Aliyun/fromNotify", "AliyunController@fromNotify");
    });

    //阿里云地址
    $api->group(['namespace' => 'App\Api\V2\Controller\Redirect', 'prefix' => 'v2/Redirect'], function ($api) {

        //https://test-pay.zgjindoufu.com/api/v2/Notify/AliyunNotify/notify
        $api->any("/Aliyun/sourceCode", "AliyunController@sourceCode");
    });

};
$api->version("v1", $func);









/*   Route::group(["prefix" => "v2"], function () {

       Route::group(["prefix" => "incoming"], function () {
           Route::group(["prefix" => "Qr", "middleware" => \App\Http\Middleware\AuthenticateApi::class], function () {
               Route::post("createQr", "\App\Api\V2\Controller\Incoming\QrController@createQr");

               Route::get("lists", "\App\Api\V2\Controller\Incoming\QrController@lists");
           });

       });
   });*/

